package com.example.administrator.lazero_xposed;
//
//package ai.lazero.lazero;

import de.robv.android.xposed.IXposedHookLoadPackage;

import de.robv.android.xposed.XC_MethodHook;

import de.robv.android.xposed.XposedBridge;

import de.robv.android.xposed.XposedHelpers;

import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class HookTest implements IXposedHookLoadPackage {

    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {

        if (loadPackageParam.packageName.equals("ai.lazero.lazero")) {

            XposedBridge.log("has Hooked!");

//            XposedHelpers.
            Class clazz = loadPackageParam.classLoader.loadClass(

                    "ai.lazero.lazero.m6.Main8Activity");

            XposedHelpers.findAndHookMethod(clazz, "toastMessage", Object.class, new XC_MethodHook() {

                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {

                    super.beforeHookedMethod(param);

                    XposedBridge.log("method has Hooked!");

                }

                protected void afterHookedMethod(MethodHookParam param) throws Throwable {

                    param.setResult("你已被劫持");

                }

            });

        }

    }

}